TextlessActionWidget

class TextlessActionWidget(activeIcon: Identifier, inactiveIcon: Identifier, highlightedIcon: Identifier, activeNarration: Text, inactiveNarration: Text, activeSupplier: Supplier<Boolean>, pressAction: Consumer<TextlessActionWidget>) : CustomPressableWidget

A button widget that is 20x20 pixels and displays a sprite instead of a textual message

Author

fzzyhmstrs

Since

0.2.0

Parameters

activeIcon

Identifier - sprite id for active-but-not-hovered state

inactiveIcon

Identifier - sprite id for inactive/disabled state, controlled via activeSupplier

highlightedIcon

Identifier - sprite id for the active-and-hovered state

activeNarration

Text - the tooltip and narration for active states

inactiveNarration

Text - narration and tooltip to display if the button is inactive

activeSupplier

Supplier - supplies whether this widget should be active

pressAction

Consumer - action to take on press

Constructors

Link copied to clipboard
constructor(activeIcon: Identifier, inactiveIcon: Identifier, highlightedIcon: Identifier, activeNarration: Text, inactiveNarration: Text, activeSupplier: Supplier<Boolean>, pressAction: Consumer<TextlessActionWidget>)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var message: Text
Link copied to clipboard
Link copied to clipboard
@Nullable
@get:Nullable
var tooltip: Tooltip?
Link copied to clipboard
Link copied to clipboard
var x: Int
Link copied to clipboard
var y: Int

Functions

Link copied to clipboard
override fun appendNarrations(builder: NarrationMessageBuilder)
Link copied to clipboard
open fun charTyped(chr: Char, modifiers: Int): Boolean
Link copied to clipboard
open fun drawMessage(context: DrawContext?, textRenderer: TextRenderer?, color: Int)
Link copied to clipboard
open fun drawTexture(context: DrawContext, texture: Identifier, x: Int, y: Int, u: Int, v: Int, hoveredVOffset: Int, width: Int, height: Int, textureWidth: Int, textureHeight: Int)
Link copied to clipboard
open override fun forEachChild(consumer: Consumer<ClickableWidget>)
Link copied to clipboard
@Nullable
open fun getFocusedPath(): GuiNavigationPath?
Link copied to clipboard
open override fun getHeight(): Int
Link copied to clipboard
open override fun getNavigationFocus(): ScreenRect
Link copied to clipboard
@Nullable
open override fun getNavigationPath(navigation: GuiNavigation): GuiNavigationPath?
Link copied to clipboard
open override fun getType(): Selectable.SelectionType
Link copied to clipboard
open override fun getWidth(): Int
Link copied to clipboard
open fun isHovered(): Boolean
Link copied to clipboard
open override fun isMouseOver(mouseX: Double, mouseY: Double): Boolean
Link copied to clipboard
open override fun isNarratable(): Boolean
Link copied to clipboard
open fun isSelected(): Boolean
Link copied to clipboard
open override fun keyPressed(keyCode: Int, scanCode: Int, modifiers: Int): Boolean
Link copied to clipboard
open fun keyReleased(keyCode: Int, scanCode: Int, modifiers: Int): Boolean
Link copied to clipboard
open override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean
Link copied to clipboard
open override fun mouseDragged(mouseX: Double, mouseY: Double, button: Int, deltaX: Double, deltaY: Double): Boolean
Link copied to clipboard
open fun mouseMoved(mouseX: Double, mouseY: Double)
Link copied to clipboard
open override fun mouseReleased(mouseX: Double, mouseY: Double, button: Int): Boolean
Link copied to clipboard
open fun mouseScrolled(mouseX: Double, mouseY: Double, amount: Double): Boolean
Link copied to clipboard
open override fun onClick(mouseX: Double, mouseY: Double)
Link copied to clipboard
open override fun onPress()
Link copied to clipboard
open fun onRelease(mouseX: Double, mouseY: Double)
Link copied to clipboard
open fun playDownSound(soundManager: SoundManager)
Link copied to clipboard
open override fun render(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float)
Link copied to clipboard
open fun setAlpha(alpha: Float)
Link copied to clipboard
open fun setPosition(x: Int, y: Int)
Link copied to clipboard
open fun setTooltipDelay(delay: Int)
Link copied to clipboard
open fun setWidth(width: Int)